package com.ruoyi.user.controller;

import com.ruoyi.common.core.domain.IdVo;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.common.core.domain.RolePermVo;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.user.domain.TbRolePerm;
import com.ruoyi.user.service.TbRolePermService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 咸鱼
 * @version 1.0
 * @description: TODO
 * @date 2023/1/13 13:59
 */
@RestController
@RequestMapping("/rolePerm")
public class TbRolePermController {

    @Autowired
    private TbRolePermService tbRolePermService;

    @PostMapping("/addRolePerm")
    public R addRolePerm(@RequestBody RolePermVo rolePermVo){
        return tbRolePermService.addRolePerm(rolePermVo);
    }

    @PostMapping("/deleteRolePerm")
    public R deleteRolePerm(@RequestBody IdVo idVo){
        return tbRolePermService.deleteRolePerm(idVo);
    }

    @PostMapping("/selectRolePerm")
    public AjaxResult selectRolePerm(){
        return tbRolePermService.selectRolePerm();
    }

    @PostMapping("/updateRolePerm")
    public R updateRolePerm(@RequestBody RolePermVo rolePermVo){
        return tbRolePermService.updateRolePerm(rolePermVo);
    }
}
